<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tinyOS: tEvent.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">tinyOS
   &#160;<span id="projectnumber">v1.00</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('t_event_8c_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">tEvent.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="t_event_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="tiny_o_s_8h.html">tinyOS.h</a>&quot;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga5ca43de9442770133c4c2ac38e696049">   21</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga5ca43de9442770133c4c2ac38e696049">tEventInit</a> (<a class="code" href="struct__t_event.html">tEvent</a> *event, <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga2f657c7650619d8e13c315d7f387757c">tEventType</a> type) {</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <span class="keyword">event</span>-&gt;type = type;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gab4cbecbc9ce397733c027de83ce17f81">tListInit</a>(&amp;event-&gt;<a class="code" href="struct__t_event.html#a8e54a36f1038a12d9206c6ed20fab2a2">waitList</a>);</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;}</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga0bbda829b0d83072138caad66f98899a">   35</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga0bbda829b0d83072138caad66f98899a">tEventWait</a> (<a class="code" href="struct__t_event.html">tEvent</a> *event, <a class="code" href="struct__t_task.html">tTask</a> *task, <span class="keywordtype">void</span> *msg, uint32_t state, uint32_t timeout) {</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> |= state;                   <span class="comment">// 标记任务处于等待某种事件的状态</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a61a5517ac5c5a5149cf4b7d438e5c859">waitEvent</a> = event;                <span class="comment">// 设置任务等待的事件结构</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#ae1ae004c581e0cc9fd22662535700001">eventMsg</a> = msg;                   <span class="comment">// 设置任务等待事件的消息存储位置</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="comment">// 因有时候需要接受消息，所以需要接受区</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">waitEventResult</a> = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>;  <span class="comment">// 清空事件的等待结果</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <span class="comment">// 将任务从就绪队列中移除</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f3aa47609478099b79d1520a9baf9b3">tTaskSchedUnRdy</a>(task);</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="comment">// 将任务插入到等待队列中</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga6278d548e9b37d514acbebc25617f1b6">tListAddLast</a>(&amp;event-&gt;<a class="code" href="struct__t_event.html#a8e54a36f1038a12d9206c6ed20fab2a2">waitList</a>, &amp;task-&gt;<a class="code" href="struct__t_task.html#ab9a5b93b6f7bf200c776df8731d99133">linkNode</a>);</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="comment">// 如果发现有设置超时，在同时插入到延时队列中</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="comment">// 当时间到达时，由延时处理机制负责将任务从延时列表中移除，同时从事件列表中移除</span></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keywordflow">if</span> (timeout) {</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga1f612696830f8adeb411745ff719377c">tTimeTaskWait</a>(task, timeout);</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    }</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;}</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gae1e675e01faa9fd2a37ab29b2092d646">   68</a></span>&#160;<a class="code" href="struct__t_task.html">tTask</a> *<a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gae1e675e01faa9fd2a37ab29b2092d646">tEventWakeUp</a> (<a class="code" href="struct__t_event.html">tEvent</a> *event, <span class="keywordtype">void</span> *msg, uint32_t result) {</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <a class="code" href="struct__t_node.html">tNode</a> *node;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <a class="code" href="struct__t_task.html">tTask</a> *task = (<a class="code" href="struct__t_task.html">tTask</a> *) 0;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="comment">// 取出等待队列中的第一个结点</span></div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="keywordflow">if</span> ((node = <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gaf2dc8b31ed5ec5aac0b7bebc21448a78">tListRemoveFirst</a>(&amp;event-&gt;<a class="code" href="struct__t_event.html#a8e54a36f1038a12d9206c6ed20fab2a2">waitList</a>)) != (<a class="code" href="struct__t_node.html">tNode</a> *) 0) {</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="comment">// 转换为相应的任务结构</span></div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        task = (<a class="code" href="struct__t_task.html">tTask</a> *) <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga5a79804168bfcc4553dcf0a57d22724d">tNodeParent</a>(node, <a class="code" href="struct__t_task.html">tTask</a>, linkNode);</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <span class="comment">// 设置收到的消息、结构，清除相应的等待标志位</span></div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        task-&gt;<a class="code" href="struct__t_task.html#a61a5517ac5c5a5149cf4b7d438e5c859">waitEvent</a> = (<a class="code" href="struct__t_event.html">tEvent</a> *) 0;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        task-&gt;<a class="code" href="struct__t_task.html#ae1ae004c581e0cc9fd22662535700001">eventMsg</a> = msg;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        task-&gt;<a class="code" href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">waitEventResult</a> = result;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> &amp;= ~<a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gab663c09edc989829da8ab2f037b99b11">TINYOS_TASK_WAIT_MASK</a>;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <span class="comment">// 任务申请了超时等待，这里检查下，将其从延时队列中移除</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <span class="keywordflow">if</span> (task-&gt;<a class="code" href="struct__t_task.html#a0c1ef2b42e60232fd2355246df290c68">delayTicks</a> != 0) {</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga5086649a1a0f0337850b059e6d28807e">tTimeTaskWakeUp</a>(task);</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        }</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <span class="comment">// 将任务加入就绪队列</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0">tTaskSchedRdy</a>(task);</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    }</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keywordflow">return</span> task;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;}</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gaf035c08c00e607bf3019020ee09bf3c8">  109</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gaf035c08c00e607bf3019020ee09bf3c8">tEventWakeUpTask</a> (<a class="code" href="struct__t_event.html">tEvent</a> *event, <a class="code" href="struct__t_task.html">tTask</a> *task, <span class="keywordtype">void</span> *msg, uint32_t result) {</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga58e2fef327c5254062441ec2f8a101a6">tListRemove</a>(&amp;event-&gt;<a class="code" href="struct__t_event.html#a8e54a36f1038a12d9206c6ed20fab2a2">waitList</a>, &amp;task-&gt;<a class="code" href="struct__t_task.html#ab9a5b93b6f7bf200c776df8731d99133">linkNode</a>);</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="comment">// 设置收到的消息、结构，清除相应的等待标志位</span></div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a61a5517ac5c5a5149cf4b7d438e5c859">waitEvent</a> = (<a class="code" href="struct__t_event.html">tEvent</a> *) 0;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#ae1ae004c581e0cc9fd22662535700001">eventMsg</a> = msg;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">waitEventResult</a> = result;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> &amp;= ~<a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gab663c09edc989829da8ab2f037b99b11">TINYOS_TASK_WAIT_MASK</a>;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="comment">// 任务申请了超时等待，这里检查下，将其从延时队列中移除</span></div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="keywordflow">if</span> (task-&gt;<a class="code" href="struct__t_task.html#a0c1ef2b42e60232fd2355246df290c68">delayTicks</a> != 0) {</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga5086649a1a0f0337850b059e6d28807e">tTimeTaskWakeUp</a>(task);</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    }</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="comment">// 将任务加入就绪队列</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0">tTaskSchedRdy</a>(task);</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;}</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga8d21f6237cc8ac3ec38687e1f7fa4999">  138</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga8d21f6237cc8ac3ec38687e1f7fa4999">tEventRemoveTask</a> (<a class="code" href="struct__t_task.html">tTask</a> *task, <span class="keywordtype">void</span> *msg, uint32_t result) {</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="comment">// 将任务从所在的等待队列中移除</span></div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="comment">// 注意，这里没有检查waitEvent是否为空。既然是从事件中移除，那么认为就不可能为空</span></div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga58e2fef327c5254062441ec2f8a101a6">tListRemove</a>(&amp;task-&gt;<a class="code" href="struct__t_task.html#a61a5517ac5c5a5149cf4b7d438e5c859">waitEvent</a>-&gt;<a class="code" href="struct__t_event.html#a8e54a36f1038a12d9206c6ed20fab2a2">waitList</a>, &amp;task-&gt;<a class="code" href="struct__t_task.html#ab9a5b93b6f7bf200c776df8731d99133">linkNode</a>);</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="comment">// 设置收到的消息、结构，清除相应的等待标志位</span></div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a61a5517ac5c5a5149cf4b7d438e5c859">waitEvent</a> = (<a class="code" href="struct__t_event.html">tEvent</a> *) 0;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#ae1ae004c581e0cc9fd22662535700001">eventMsg</a> = msg;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">waitEventResult</a> = result;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> &amp;= ~<a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gab663c09edc989829da8ab2f037b99b11">TINYOS_TASK_WAIT_MASK</a>;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;}</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div><div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gace850c06cc2fc2f07296e1eb4552030a">  163</a></span>&#160;uint32_t <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gace850c06cc2fc2f07296e1eb4552030a">tEventRemoveAll</a> (<a class="code" href="struct__t_event.html">tEvent</a> *event, <span class="keywordtype">void</span> *msg, uint32_t result) {</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <a class="code" href="struct__t_node.html">tNode</a> *node;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    uint32_t count;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="comment">// 获取等待中的任务数量</span></div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    count = <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gad01c0c24187a334e78e7ba6d677306cb">tListCount</a>(&amp;event-&gt;<a class="code" href="struct__t_event.html#a8e54a36f1038a12d9206c6ed20fab2a2">waitList</a>);</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <span class="comment">// 遍历所有等待中的任务</span></div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    <span class="keywordflow">while</span> ((node = <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gaf2dc8b31ed5ec5aac0b7bebc21448a78">tListRemoveFirst</a>(&amp;event-&gt;<a class="code" href="struct__t_event.html#a8e54a36f1038a12d9206c6ed20fab2a2">waitList</a>)) != (<a class="code" href="struct__t_node.html">tNode</a> *) 0) {</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;        <span class="comment">// 转换为相应的任务结构                                          </span></div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        <a class="code" href="struct__t_task.html">tTask</a> *task = (<a class="code" href="struct__t_task.html">tTask</a> *) <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga5a79804168bfcc4553dcf0a57d22724d">tNodeParent</a>(node, <a class="code" href="struct__t_task.html">tTask</a>, linkNode);</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        <span class="comment">// 设置收到的消息、结构，清除相应的等待标志位</span></div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        task-&gt;<a class="code" href="struct__t_task.html#a61a5517ac5c5a5149cf4b7d438e5c859">waitEvent</a> = (<a class="code" href="struct__t_event.html">tEvent</a> *) 0;</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;        task-&gt;<a class="code" href="struct__t_task.html#ae1ae004c581e0cc9fd22662535700001">eventMsg</a> = msg;</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        task-&gt;<a class="code" href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">waitEventResult</a> = result;</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        task-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> &amp;= ~<a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gab663c09edc989829da8ab2f037b99b11">TINYOS_TASK_WAIT_MASK</a>;</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;        <span class="comment">// 任务申请了超时等待，这里检查下，将其从延时队列中移除</span></div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        <span class="keywordflow">if</span> (task-&gt;<a class="code" href="struct__t_task.html#a0c1ef2b42e60232fd2355246df290c68">delayTicks</a> != 0) {</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga5086649a1a0f0337850b059e6d28807e">tTimeTaskWakeUp</a>(task);</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;        }</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        <span class="comment">// 将任务加入就绪队列</span></div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0">tTaskSchedRdy</a>(task);</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    }</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    <span class="keywordflow">return</span> count;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;}</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00206"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga312cd12071f2d18172b4020079af49a2">  206</a></span>&#160;uint32_t <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga312cd12071f2d18172b4020079af49a2">tEventWaitCount</a> (<a class="code" href="struct__t_event.html">tEvent</a> *event) {</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    uint32_t count = 0;</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <span class="comment">// 进入临界区</span></div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    count = <a class="code" href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gad01c0c24187a334e78e7ba6d677306cb">tListCount</a>(&amp;event-&gt;<a class="code" href="struct__t_event.html#a8e54a36f1038a12d9206c6ed20fab2a2">waitList</a>);</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    <span class="comment">// 退出临界区</span></div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <span class="keywordflow">return</span> count;</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;}</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;</div><div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_gab663c09edc989829da8ab2f037b99b11"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gab663c09edc989829da8ab2f037b99b11">TINYOS_TASK_WAIT_MASK</a></div><div class="ttdeci">#define TINYOS_TASK_WAIT_MASK</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00022">tTask.h:22</a></div></div>
<div class="ttc" id="struct__t_task_html"><div class="ttname"><a href="struct__t_task.html">_tTask</a></div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00031">tTask.h:31</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga1f612696830f8adeb411745ff719377c"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga1f612696830f8adeb411745ff719377c">tTimeTaskWait</a></div><div class="ttdeci">void tTimeTaskWait(tTask *task, uint32_t ticks)</div><div class="ttdoc">将任务加入延时队列中 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00167">tCore.c:167</a></div></div>
<div class="ttc" id="struct__t_task_html_ae1ae004c581e0cc9fd22662535700001"><div class="ttname"><a href="struct__t_task.html#ae1ae004c581e0cc9fd22662535700001">_tTask::eventMsg</a></div><div class="ttdeci">void * eventMsg</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00058">tTask.h:58</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga5086649a1a0f0337850b059e6d28807e"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga5086649a1a0f0337850b059e6d28807e">tTimeTaskWakeUp</a></div><div class="ttdeci">void tTimeTaskWakeUp(tTask *task)</div><div class="ttdoc">将延时的任务从延时队列中唤醒 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00177">tCore.c:177</a></div></div>
<div class="ttc" id="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_ga58e2fef327c5254062441ec2f8a101a6"><div class="ttname"><a href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga58e2fef327c5254062441ec2f8a101a6">tListRemove</a></div><div class="ttdeci">void tListRemove(tList *list, tNode *node)</div><div class="ttdef"><b>Definition:</b> <a href="t_list_8c_source.html#l00200">tList.c:200</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_gace850c06cc2fc2f07296e1eb4552030a"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gace850c06cc2fc2f07296e1eb4552030a">tEventRemoveAll</a></div><div class="ttdeci">uint32_t tEventRemoveAll(tEvent *event, void *msg, uint32_t result)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00163">tEvent.c:163</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gab4d6c802c474b9071f48312bed3dec74"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a></div><div class="ttdeci">tTaskCritical_t tTaskEnterCritical(void)</div><div class="ttdef"><b>Definition:</b> <a href="t_switch_8c_source.html#l00036">tSwitch.c:36</a></div></div>
<div class="ttc" id="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_ga5a79804168bfcc4553dcf0a57d22724d"><div class="ttname"><a href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga5a79804168bfcc4553dcf0a57d22724d">tNodeParent</a></div><div class="ttdeci">#define tNodeParent(node, parent, name)</div><div class="ttdef"><b>Definition:</b> <a href="t_lib_8h_source.html#l00048">tLib.h:48</a></div></div>
<div class="ttc" id="struct__t_event_html_a8e54a36f1038a12d9206c6ed20fab2a2"><div class="ttname"><a href="struct__t_event.html#a8e54a36f1038a12d9206c6ed20fab2a2">_tEvent::waitList</a></div><div class="ttdeci">tList waitList</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8h_source.html#l00034">tEvent.h:34</a></div></div>
<div class="ttc" id="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_gaf2dc8b31ed5ec5aac0b7bebc21448a78"><div class="ttname"><a href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gaf2dc8b31ed5ec5aac0b7bebc21448a78">tListRemoveFirst</a></div><div class="ttdeci">tNode * tListRemoveFirst(tList *list)</div><div class="ttdef"><b>Definition:</b> <a href="t_list_8c_source.html#l00162">tList.c:162</a></div></div>
<div class="ttc" id="struct__t_task_html_a61a5517ac5c5a5149cf4b7d438e5c859"><div class="ttname"><a href="struct__t_task.html#a61a5517ac5c5a5149cf4b7d438e5c859">_tTask::waitEvent</a></div><div class="ttdeci">struct _tEvent * waitEvent</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00057">tTask.h:57</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_ga312cd12071f2d18172b4020079af49a2"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga312cd12071f2d18172b4020079af49a2">tEventWaitCount</a></div><div class="ttdeci">uint32_t tEventWaitCount(tEvent *event)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00206">tEvent.c:206</a></div></div>
<div class="ttc" id="struct__t_node_html"><div class="ttname"><a href="struct__t_node.html">_tNode</a></div><div class="ttdef"><b>Definition:</b> <a href="t_lib_8h_source.html#l00035">tLib.h:35</a></div></div>
<div class="ttc" id="struct__t_event_html"><div class="ttname"><a href="struct__t_event.html">_tEvent</a></div><div class="ttdef"><b>Definition:</b> <a href="t_event_8h_source.html#l00032">tEvent.h:32</a></div></div>
<div class="ttc" id="tiny_o_s_8h_html"><div class="ttname"><a href="tiny_o_s_8h.html">tinyOS.h</a></div></div>
<div class="ttc" id="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_ga6278d548e9b37d514acbebc25617f1b6"><div class="ttname"><a href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga6278d548e9b37d514acbebc25617f1b6">tListAddLast</a></div><div class="ttdeci">void tListAddLast(tList *list, tNode *node)</div><div class="ttdef"><b>Definition:</b> <a href="t_list_8c_source.html#l00148">tList.c:148</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_ga5ca43de9442770133c4c2ac38e696049"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga5ca43de9442770133c4c2ac38e696049">tEventInit</a></div><div class="ttdeci">void tEventInit(tEvent *event, tEventType type)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00021">tEvent.c:21</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_ga8d21f6237cc8ac3ec38687e1f7fa4999"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga8d21f6237cc8ac3ec38687e1f7fa4999">tEventRemoveTask</a></div><div class="ttdeci">void tEventRemoveTask(tTask *task, void *msg, uint32_t result)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00138">tEvent.c:138</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_ga2f657c7650619d8e13c315d7f387757c"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga2f657c7650619d8e13c315d7f387757c">tEventType</a></div><div class="ttdeci">enum _tEventType tEventType</div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga21b4efbc4cb710d7d0e71678d2b13e53"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a></div><div class="ttdeci">void tTaskExitCritical(tTaskCritical_t status)</div><div class="ttdef"><b>Definition:</b> <a href="t_switch_8c_source.html#l00047">tSwitch.c:47</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_ga0bbda829b0d83072138caad66f98899a"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga0bbda829b0d83072138caad66f98899a">tEventWait</a></div><div class="ttdeci">void tEventWait(tEvent *event, tTask *task, void *msg, uint32_t state, uint32_t timeout)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00035">tEvent.c:35</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_gaf035c08c00e607bf3019020ee09bf3c8"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gaf035c08c00e607bf3019020ee09bf3c8">tEventWakeUpTask</a></div><div class="ttdeci">void tEventWakeUpTask(tEvent *event, tTask *task, void *msg, uint32_t result)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00109">tEvent.c:109</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gab7c2dfbda696e43a8c35ab97731837a0"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0">tTaskSchedRdy</a></div><div class="ttdeci">void tTaskSchedRdy(tTask *task)</div><div class="ttdoc">将任务设置为就绪状态 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00093">tCore.c:93</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a></div><div class="ttdef"><b>Definition:</b> <a href="tiny_o_s_8h_source.html#l00034">tinyOS.h:34</a></div></div>
<div class="ttc" id="struct__t_task_html_a1b0c7bd4d79798ef4e0ce23894c9aeb2"><div class="ttname"><a href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">_tTask::state</a></div><div class="ttdeci">uint32_t state</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00047">tTask.h:47</a></div></div>
<div class="ttc" id="struct__t_task_html_ab9a5b93b6f7bf200c776df8731d99133"><div class="ttname"><a href="struct__t_task.html#ab9a5b93b6f7bf200c776df8731d99133">_tTask::linkNode</a></div><div class="ttdeci">tNode linkNode</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00040">tTask.h:40</a></div></div>
<div class="ttc" id="struct__t_task_html_a0c1ef2b42e60232fd2355246df290c68"><div class="ttname"><a href="struct__t_task.html#a0c1ef2b42e60232fd2355246df290c68">_tTask::delayTicks</a></div><div class="ttdeci">uint32_t delayTicks</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00042">tTask.h:42</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga6f3aa47609478099b79d1520a9baf9b3"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f3aa47609478099b79d1520a9baf9b3">tTaskSchedUnRdy</a></div><div class="ttdeci">void tTaskSchedUnRdy(tTask *task)</div><div class="ttdoc">将任务从就绪列表中移除 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00102">tCore.c:102</a></div></div>
<div class="ttc" id="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_gad01c0c24187a334e78e7ba6d677306cb"><div class="ttname"><a href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gad01c0c24187a334e78e7ba6d677306cb">tListCount</a></div><div class="ttdeci">uint32_t tListCount(tList *list)</div><div class="ttdef"><b>Definition:</b> <a href="t_list_8c_source.html#l00043">tList.c:43</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_gae1e675e01faa9fd2a37ab29b2092d646"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gae1e675e01faa9fd2a37ab29b2092d646">tEventWakeUp</a></div><div class="ttdeci">tTask * tEventWakeUp(tEvent *event, void *msg, uint32_t result)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00068">tEvent.c:68</a></div></div>
<div class="ttc" id="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_gab4cbecbc9ce397733c027de83ce17f81"><div class="ttname"><a href="group___xE5_x8F_x8C_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gab4cbecbc9ce397733c027de83ce17f81">tListInit</a></div><div class="ttdeci">void tListInit(tList *list)</div><div class="ttdef"><b>Definition:</b> <a href="t_list_8c_source.html#l00032">tList.c:32</a></div></div>
<div class="ttc" id="struct__t_task_html_a37707d87e42a484588393e5b3683ffbb"><div class="ttname"><a href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">_tTask::waitEventResult</a></div><div class="ttdeci">uint32_t waitEventResult</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00059">tTask.h:59</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="t_event_8c.html">tEvent.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
